package com.longma.server.constant.enums;


/**
 * @Author: zy
 * @Description: 云仓状态
 * @Date: 2020/2/19
 */
public enum YuncangStateEnum implements IBaseEnum<Integer> {
    // 运行
    RUNNING(0,"运行"),

    //报警
    ALARMING(1,"报警"),

    //禁用
    STOPPING(2,"停止");

    /**
     * 值
     */
    private int value;

    /*
     * 描述信息
     */
    private String desc;

    /**
     * 构造函数
     */
    YuncangStateEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    /**
     * 通过值转为枚举类型
     */
    public static YuncangStateEnum fromValue(int value) {
        switch (value) {
            case 0:
                return RUNNING;
            case 1:
                return ALARMING;
            case 2:
                return STOPPING;
            default:
                throw new IllegalArgumentException();
        }
    }

    /**
     * 获取值
     */
    @Override
    public Integer getValue() {
        return this.value;
    }

    @Override
    public String getDesc() {
        return  this.desc;
    }

}